package demo03;

import demo03.gun.RowsLexer;
import demo03.gun.RowsParser;
import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CommonTokenStream;

import java.io.FileInputStream;
import java.io.InputStream;

/**
 * Created by Administrator on 2016/6/23.
 */
public class RowsClient {
    public static void main(String[] args) throws Exception {
        String path = RowsClient.class.getResource("").getPath() ;
        path = path + "rows.text" ;
        InputStream is = new FileInputStream(path) ;
        ANTLRInputStream input = new ANTLRInputStream(is);

        RowsLexer lexer = new RowsLexer(input);
        CommonTokenStream token = new CommonTokenStream(lexer) ;
        RowsParser parser = new RowsParser(token,1) ;
        parser.setBuildParseTree(false);
        parser.file() ;
    }
}
